package com.owen.server.impl;

import com.owen.dao.CakeDao;
import com.owen.pojo.Cake;
import com.owen.server.CakeServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CakeServerImpl implements CakeServer {

    @Autowired
    private CakeDao cakeDao;

    @Override
    public List<Cake> findAll() {
        return cakeDao.findAll();
    }

    @Override
    public List<Cake> findByCake(Cake cake, Long[] ids) {
        return cakeDao.findByCake(cake, ids);
    }

    @Override
    public Cake findById(Long id) {
        return cakeDao.findById(id);
    }

    @Override
    public Cake findCakeById(Long id) {
        return cakeDao.findCakeById(id);
    }

    @Override
    public Integer deleteBatch(Integer[] ids) {
        return cakeDao.deleteBatch(ids);
    }

    @Override
    public Integer deleteById(Long id) {
        return cakeDao.deleteById(id);
    }

    @Override
    public Integer updateById(Cake cake) {
        return cakeDao.updateById(cake);
    }

    @Override
    public Integer addCake(Cake cake) {
        return cakeDao.addCake(cake);
    }

    @Override
    public Integer addFruitsCake(Integer cakeId, Integer fruitsId) {
        return cakeDao.addFruitsCake(cakeId, fruitsId);
    }

    @Override
    public Integer deleteFruitsCake(Integer id) {
        return cakeDao.deleteFruitsCake(id);
    }
}